<include file="Public/base"/>

<div class="pd-20">
    <form action="" method="post" class="form form-horizontal" id="addGoodForm">
        <!--<div class="row cl">
            <label class="form-label col-3">商品编号</label>
            <div class="formControls col-5">
                <input type="hidden" class="input-text" name="goodid" value="" required minlength="2" maxlength="20"
                       id="good_id" _target="{:U($Think.ADMIN_PATH_NAME.'Good/NRLable/checkLable')}">
            </div>
        </div>-->
    <input type="hidden" class="input-text" name="goodid" value="{$data.id}"  />
        <div class="row cl">
            <label class="form-label col-3">商品名称</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" name="goodname" value="{$data.name}" required minlength="2" maxlength="20"
                       id="good_name">
            </div>
        </div>
        <!--<div class="row cl">
            <label class="form-label col-3">缩略图</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" name="goodpic" value="" required minlength="2" maxlength="20"
                       id="good_pic" _target="{:U($Think.ADMIN_PATH_NAME.'Good/NRLable/checkLable')}">
            </div>
        </div>-->
        <!--<div class="row cl">
            <label class="form-label col-3">价格</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" name="goodprice" value="" required minlength="2" maxlength="20"
                       id="good_price" _target="{:U($Think.ADMIN_PATH_NAME.'Good/NRLable/checkLable')}">
            </div>
        </div>-->
        <!--<div class="row cl">
            <label class="form-label col-3">分类</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" name="goodclassify" value="" required minlength="2" maxlength="20"
                       id="good_classify" _target="{:U($Think.ADMIN_PATH_NAME.'Good/NRLable/checkLable')}">
            </div>
        </div>-->
        <div class="row cl">
            <label class="form-label col-3">标签</label>
           
            
            
            <div class="formControls col-6">
            	<volist name="lableData" id="vo">
            		
                	<input type="checkbox"  class="lable" value="{$vo.id}" <in name="vo.id" value="$yuanLable">checked</in> />
                	{$vo.name}
                	&nbsp;&nbsp;
                </volist>
            </div>
             
        </div>
        </form>
        <div class="row cl">
            <div class="col-9 col-offset-3">
                <button class="btn btn-primary radius" id="submit" >确 定
                </button>
                <button class="btn btn-warning radius" onclick="history.back(-1);return false;">返 回</button>
            </div>
        </div>
    
</div>

<script>
	$(function(){
		$("#submit").click(function(){
			//alert($("input.lable:checked").length);
			var arr=[];
			for(var i=0;i<$("input.lable:checked").length;i++){
				//alert($("input.lable:checked").eq(i).val());
				arr[i]=$("input.lable:checked").eq(i).val();
			}
			var id=$("input[name=goodid]").val();
			//alert($("input[name=goodid]").val());
			$.ajax({
				type:'post',
				data:{id:id,arr:arr},
				dataType:'json',
				url:"<?php $str = $Think.ADMIN_PATH_NAME.$actions['CLASSIFYDELETEUPDATE']['url'];echo U($str,array('key'=>$actions['CLASSIFYDELETEUPDATE']['key']))?>",
				success:function(p){
					alert(p);
					window.location.reload();
				}
			})
		})
	})
</script>


<!--<script src="__JS__/Good/lable.js"></script>-->
